#include "ThreadPool.hpp"
#include "Task.hpp"
using namespace std;

int main()
{
    ThreadPool<Task> *tp = ThreadPool<Task>::getInstance();
    tp->start();
    srand(time(nullptr) ^ getpid());

    while (true)
    {
        int x = rand() % 10 + 1;
        usleep(10);
        int y = rand() % 10;
        char op = ops[rand() % ops.size()];

        Task t(x, y, op);
        tp->push(t);
        cout << "main thread get a task:" << t.getTask() << endl;
        sleep(1);
    }
    return 0;
}